#pragma once

#ifndef CommonParent_h
#define CommonParent_h

#include <vector>
#include <map>
#include "Type.h"

class CommonParent{

private:
	Type::Map::ParentMatrix commonWhile;
	Type::Map::ParentMatrix commonIf;

public:
	CommonParent(void);
	~CommonParent(void);
	void clear();

	// set the bitmap (square matrix) for parent-parent of common parent between 2 parents
	bool setCommon(Type::Entity::Line, Type::Map::ParentMatrix&);

	// get the common parent of parent 1 and 2
	Type::Index::Line getCommon(Type::Entity::Line, Type::Index::Line, Type::Index::Line);

	// check if the common parent of parent 1 and 2 matches the given parent
	bool isCommon(Type::Entity::Line, Type::Index::Line, Type::Index::Line, Type::Index::Line);
};
#endif